package net.lcqf.http.exception;

/**
 * Exception 拦截
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a>)
 * +----------------------------------------------------------------------
 * | @Author: 贯彻己道的云 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/2 12:06
 * +----------------------------------------------------------------------
 */
public enum ExceptionCodeEnum implements ExceptionHandler {
    // 数据操作错误定义
    SUCCESS(200, "success"),
    FAILED(405, "failed"),
    UNAUTHORIZED(401, "未登录或token过期，请登录！"),
    FORBIDDEN(403, "没有相关权限"),
    NOT_FOUND(404, "请输入正确的路径"),
    ERROR(500, "系统异常"),
    ;

    // 状态码
    private int code;
    // 结果信息
    private String message;

    ExceptionCodeEnum(int code, String message){
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}